<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<s:action name="header" executeResult="true">
	<s:param name="titles">Liên Hệ</s:param>
</s:action>
<s:action name="sidebar" executeResult="true" />

<!-- Center -->
<div id="center_column_des" class="center_column">

<!-- MODULE contact-->
<!-- Breadcrumb -->
<div class="breadcrumb">
	<a href="<s:url action="index"></s:url>" title="Quay trở lại trang chủ">Trang chủ</a><span class="navigation-pipe">&gt;</span><span class="navigation_page">Liên hệ</span>
</div>
<!-- /Breadcrumb -->
	<form action="<s:url action="contact"></s:url>" method="post" class="std" enctype="multipart/form-data" name="contact" id="contact">
		<fieldset>
			<h3>Gửi phản hồi</h3>
			<p class="text">
				<s:textfield name="email" id="email" label="Địa chỉ E-mail" />				
			</p>
			<p class="text">
				<s:textfield name="title" id="title" label="Tiêu đề" />				
			</p>
			<p class="textarea">
				<s:textarea name="message" id="message" label="Nội dung" rows="5" cols="80"/>
			</p>
			<p class="submit">
				<input type="submit" name="submitMessage" id="submitMessage"
					value="Gửi" class="button_large">
			</p>
		</fieldset>
	</form>
	<!-- /MODULE contact -->		
<script type="text/javascript">
$().ready(function() {
	$('#submitMessage').click(function() { 		 
        $(".error").remove();
        var hasError = false;
        var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
 
        var emailaddressVal = $("#email").val();
        var titleVal = $("#title").val();
        var messageVal = $("#message").val();
        if($.trim(emailaddressVal) == '') {
            $("#email").after('<span style="margin-left: 10px;color: #CC0000;" class="error">Vui lòng nhập E-mail.</span>');
            hasError = true;
        }
 
        else if(!emailReg.test(emailaddressVal)) {
            $("#email").after('<span style="margin-left: 10px;color: #CC0000;" class="error">Địa chỉ E-mail không đúng chuẩn.</span>');
            hasError = true;
        }

        if($.trim(titleVal) == '') {
            $("#title").after('<span style="margin-left: 10px;color: #CC0000;" class="error">Vui lòng nhập tiêu đề E-mail.</span>');
            hasError = true;
        }
        
        if($.trim(messageVal) == '') {
            $("#message").after('<span style="margin-left: 157px;color: #CC0000;" class="error" >Vui lòng nhập nội dung E-mail.</span>');
            hasError = true;
        }        
        
        if(hasError == true) { return false; }

    }); 
});

</script>
</div>

<s:action name="footer" executeResult="true" />